﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

namespace HumanResorcesProj.GUI
{
    public partial class MasterFeedBacks : System.Web.UI.MasterPage
    {
         private static  int r = 1;
        protected void Page_Load(object sender, EventArgs e)
        {
            

            if (!Request.IsAuthenticated)
                Response.Redirect("~/GUI/Login/Login.aspx");
            FormsIdentity identity = HttpContext.Current.User.Identity as FormsIdentity;
            String username = identity.Name;

            bool userRole = HttpContext.Current.User.IsInRole("user");



   ClearButtonsBg(r);
        }

        private void ClearButtonsBg(int r)
        {
            switch (r)
            {
                case 1:
                    {
                        this.Button1.CssClass = "styleBtnOn";
                        this.Button2.CssClass = "styleBtnOff";

                    }
                    break;
                case 2:
                    {
                        this.Button1.CssClass = "styleBtnOff";
                        this.Button2.CssClass = "styleBtnOn";

                    }
                    break;

                default:
                    {
                    }
                    break;
            }
        }




        protected void Button1_Click(object sender, EventArgs e)
        {
          r=1;

            Response.Redirect("FeedBackNew.aspx");
        }

        protected void Button2_Click(object sender, EventArgs e)
        {

         r=2;
            Response.Redirect("FeedBackEdit.aspx");
        }

  
    }
}
